package com.martin.fastframe.ui.penetrate

import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.martin.fastframe.R
import com.martin.fastframe.databinding.ActivityPenetrateBinding
import com.martin.lib_base.base.BaseActivity
import com.martin.lib_base.impl.EmptyViewModel

/**
 * fragmentA->viewpager->fragmentB
 * 尝试FragmentB中的点击事件穿透到FragmentA中
 */
class PenetrateActivity : BaseActivity<ActivityPenetrateBinding,EmptyViewModel>() {

    override fun getViewModelClass() = EmptyViewModel::class.java

    override fun layoutId() = R.layout.activity_penetrate

    override fun initOnCreate(savedInstanceState: Bundle?) {
        supportFragmentManager.beginTransaction()
            .add(R.id.container, AFragment())
            .commit()
    }

    companion object {
        @JvmStatic
        fun start(context: Context) {
            val starter = Intent(context, PenetrateActivity::class.java)
            context.startActivity(starter)
        }
    }
}